from flask import Flask, abort, render_template, request

app = Flask(__name__)

@app.route('/index', methods=['GET','POST'])
def index():
    if request.method == 'GET':
        return render_template('index.html')
    elif request.method == 'POST':
        name = request.form.get('name')
        password = request.form.get('password')
        if name == 'zhangsan' and password == '123':
            return 'login successed'
        else:
            abort(403)
            return '123'


if __name__ == '__main__':
    app.run()
